package com.lp.compt.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "ss_notice")
public class SsNoticeEntity implements Serializable {
    private Integer nId;
    private String nTitle;
    private String nNotice;
    private String nUser;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date nTime;
    private String nImage;

    @Id
    @Column(name = "n_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Integer getnId() {
        return nId;
    }

    public void setnId(Integer nId) {
        this.nId = nId;
    }

    @Basic
    @Column(name = "n_title")
    public String getnTitle() {
        return nTitle;
    }

    public void setnTitle(String nTitle) {
        this.nTitle = nTitle;
    }

    @Basic
    @Column(name = "n_notice")
    public String getnNotice() {
        return nNotice;
    }

    public void setnNotice(String nNotice) {
        this.nNotice = nNotice;
    }

    @Basic
    @Column(name = "n_user")
    public String getnUser() {
        return nUser;
    }

    public void setnUser(String nUser) {
        this.nUser = nUser;
    }

    @Basic
    @Column(name = "n_time")
    public Date getnTime() {
        return nTime;
    }

    public void setnTime(Date nTime) {
        this.nTime = nTime;
    }


    @Basic
    @Column(name = "n_image")
    public String getnImage() {
        return nImage;
    }

    public void setnImage(String nImage) {
        this.nImage = nImage;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SsNoticeEntity that = (SsNoticeEntity) o;
        return nId == that.nId && Objects.equals(nTitle, that.nTitle) && Objects.equals(nNotice, that.nNotice);
    }

    @Override
    public int hashCode() {
        return Objects.hash(nId, nTitle, nNotice);
    }
}
